import request from '@/utils/request'

export function getDefaultPrice(params: { billType: 'PO_IN' | 'SO_OUT'; materialId: string; partyId?: string; uomId?: string }) {
  return request({ url: '/erp/price/default', method: 'get', params })
}

export function pagePrice(params: { pageNum: number; pageSize: number; billType?: string; materialId?: string; partyId?: string }) {
  return request({ url: '/erp/price/page', method: 'get', params })
}

export function getPrice(id: string) {
  return request({ url: `/erp/price/${id}`, method: 'get' })
}

export function createPrice(data: any) {
  return request({ url: '/erp/price', method: 'post', data })
}

export function updatePrice(id: string, data: any) {
  return request({ url: `/erp/price/${id}`, method: 'put', data })
}

export function deletePrice(id: string) {
  return request({ url: `/erp/price/${id}`, method: 'delete' })
}


